You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Objective: To create a detailed and reliable record of critical system actions for security analysis and compliance.
Status: Diagnostic logging: Added diagnostic logging prints to stdout which are not structured audit logs and may not align with audit trail requirements though this is test code.
Referred Code
HasDownloadshasDownloads = (HasDownloads) driver;
newWebDriverWait(driver, Duration.ofSeconds(5), Duration.ofMillis(50))
.until(
d -> {
List<String> files = hasDownloads.getDownloadableFiles();
List<String> matchingFiles =
files.stream()
.filter((f) -> FILE_EXTENSIONS.stream().anyMatch(f::endsWith))
.collect(toList());
System.out.printf(
"[*****] FOUND %s FILES: %s; MATCHING %s FILES: %s%n",
files.size(), files, matchingFiles.size(), matchingFiles);
// ensure we hit no temporary file created by the browser while downloadingreturnmatchingFiles.size() == 2;
});
Generic: Robust Error Handling and Edge Case Management
Objective: Ensure comprehensive error handling that provides meaningful context and graceful degradation
Status: Test wait logic: The polling wait assumes exactly two matching files without explicit handling/logging for timeouts beyond a console print, which may hinder diagnosing certain edge cases.
Referred Code
HasDownloadshasDownloads = (HasDownloads) driver;
newWebDriverWait(driver, Duration.ofSeconds(5), Duration.ofMillis(50))
.until(
d -> {
List<String> files = hasDownloads.getDownloadableFiles();
List<String> matchingFiles =
files.stream()
.filter((f) -> FILE_EXTENSIONS.stream().anyMatch(f::endsWith))
.collect(toList());
System.out.printf(
"[*****] FOUND %s FILES: %s; MATCHING %s FILES: %s%n",
files.size(), files, matchingFiles.size(), matchingFiles);
// ensure we hit no temporary file created by the browser while downloadingreturnmatchingFiles.size() == 2;
});
Objective: To ensure logs are useful for debugging and auditing without exposing sensitive information like PII, PHI, or cardholder data.
Status: Unstructured logs: Uses System.out.printf to log lists of filenames which are unstructured and could expose file names; consider structured logging or redaction even in tests if sensitive.
Referred Code
System.out.printf(
"[*****] FOUND %s FILES: %s; MATCHING %s FILES: %s%n",
files.size(), files, matchingFiles.size(), matchingFiles);
// ensure we hit no temporary file created by the browser while downloading
The suggestion advises reverting the CI configuration changes in files like ci.yml and ci-java.yml. These changes disable tests for multiple languages and platforms, which is unsuitable for a final merge as it compromises regression testing.
Why: The suggestion correctly identifies that the PR disables most of the CI pipeline, which is a critical issue, and rightly advises reverting these temporary debugging changes before merging.
High
Learned best practice
Ensure driver cleanup with finally
Wrap driver usage in try/finally and call driver.quit() in finally so the session closes even if waits or assertions fail.
[To ensure code accuracy, apply this suggestion manually]
Suggestion importance[1-10]: 6
__
Why:
Relevant best practice - Always ensure external resources (e.g., WebDriver sessions) are cleaned up via try/finally to prevent leaks when assertions or waits fail.
Low
Possible issue
Remove duplicated test from CI
Remove the duplicate //java/test/org/openqa/selenium/grid/router:RemoteWebDriverDownloadTest target from the bazel test command to avoid running the same test suite twice and reduce CI job duration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
💥 What does this PR do?
Investigate this flaky test:
e.g. https://github.com/SeleniumHQ/selenium/actions/runs/20090736672/job/57637952727?pr=16713
🔄 Types of changes
PR Type
Bug fix, Tests
Description
Add diagnostic logging to investigate flaky download test
Convert canDownloadFiles test to repeated test (20 iterations)
Improve WebDriverWait polling with explicit poll interval
Temporarily disable non-Java CI workflows for investigation
File Walkthrough
RemoteWebDriverDownloadTest.java
Add diagnostics and repeat flaky download testjava/test/org/openqa/selenium/grid/router/RemoteWebDriverDownloadTest.java
during download wait
canDownloadFiles()from single@Testto@RepeatedTest(20)forflakiness investigation
WebDriverWaitwith explicit poll interval of 50ms for moreresponsive polling
toList()andimproved code readability
ci-java.yml
Disable macOS and remote CI jobs temporarily.github/workflows/ci-java.yml
ci.yml
Disable non-Java CI workflows temporarily.github/workflows/ci.yml